wait in the new spawned thread