[FIX] fixed bug in condition variable