fixed rand and condition_variable