solved but one semaphore problem