Added loading_check function to check if loading animation is active