adding timer and server loop to server side