Error in semaphores corrected