adding user authentication error handling