fixed some minor bugs when exiting the app