Added disconnect handler
Merge pull request #69 from stephen/stephen-fix-21

Added disconnect handler