cleanup on end
convert key to buffer correctly
support for snapshot
1.0.1