changed server timeout
added handleEvents() to client