Implement disconnect command and state change