Fix data race, add queuing of scheduled jobs