added busy wait for idling