fix copy & paste error
fix #134 (crash on exit)