This should fix the race condition with the batch timeout callback