Trying to fix race condition for jobs