added code for cancel job/job completed (needs testing)