Modifying cloud function to momh_stats