Fix issues with Application Lifecycle