added semaphore
added semaphore