Fix for login error handling