added FlushInput in places +Update WaitAction()