added leaving when disconnected