better resetting of app state at appropriate times