fixed loading screen logic