Added $response checking