allow connections to be closed properly
clean up
Merge pull request #61 from codemix/59-close-connection

59 close connection