making changes to waitTillInstanceReachState