add statusCode check