Restores the 2 semaphores and add more log