auth error handling improved