fixed bug when exiting