added blocking semaphores