app exit bug fixed