fixed stop_and_wait queue problem