fix crash on close
Merge pull request #14 from appneta/master

fix crash on close