Fixed bug: "if client is connected while server stops, client can't reconnect after server has restarted"