fix wait outside of fibers