semaphore fix in producer