Added semaphore opening/closing