Adding function to stop a job