fix for condition variable