add close support
Merge pull request #2 from brainrape/master

Add close() support