avoid ArrayIndexOutOfBoundsException in waitTillInstanceReachState
revert previous logic
Merge pull request #340 from rostafiychuk/wait

avoid ArrayIndexOutOfBoundsException in waitTillInstanceReachState