resetting of semaphore implemented