add threading for the server