Added authentication error handling