fixed app exit