I have a function which is returning a promise (parent function). Inside that function I need to wait for another function (child function) which is also returning a promise