semaphore random fix