Sendkeys() does not work but once when running the server using the shell commands

sendkeys() method works just once for me during the execution of script

steps followed are :

  1. send keys to a textbox
  2. click on a button
  3. move back
  4. clear the textbox
  5. send keys to the textbox

Appium : 1.4.8

Tap the textbox before the step 5 should work.