client server loop working