change state to disconnected when connection ends/closed