try using Semaphore