removed semaphore as it used deprecated functions, and is not in use anymore