Corrected loading/error handling to always give feedback to the user