Fix issue where a job can be scheduled twice