fix of destroy function plus corresponding tests
Merge pull request #124 from moregeek/fix_destroy

fix of destroy function plus corresponding tests