add semaphores to client; fix logout