added disconnect for reconnecting
fixed merge.