maded it so the server and clients exit properly