fix conditional variable