fixed auth error handling