Update for spawned function completing in unexpected order