Semaphore fix