Named semaphore was creating a problem. Making the semaphore as unnamed.