adding cloud function