put in a wait till queue done to help when called from multi-threaded process