Fixed the exiting problem.