Adding some locking to stop multiple crons from running