Fix the unexpected error leads to exit the application.