fix possible delay when displaying loading screen