add disconnect support
Merge pull request #1 from jamesward/jamesward/master

add disconnect support