semaphore fix