Fixed the shutdown application problem.