fix wait queue bug