Add check for internal server errors