add return $response statement in functions