Only do stuff when application is active.