Fix the issue of APP exit.