Hm - no, I don't think this is right. "done" is not used here at all. wait_for_promise_resolved is all you need. Please remove this done def'n and the waitFor at the bottom of this function.