added threading to the server