add exception handle to the job main function