Bugfixes+ replaced condition_variable with counting_semaphore