fix bug fix on exit
fix bug on exit