fix set semaphore error