addition of error handling for auth