Added semaphore for testing