bugfix in app_state_machine