Fixing statusCode check