how can we make sure that an app is in a certain state in a citrix environment?