Tweaking logic to ensure app is properly loaded