Added disconnect functionality, wow that was more work than you'd imagine it should be.