Fixed bug with schedule jobs if they die and the lock isn't removed