add some cloud functions fixes