initial
Made a bit more resiliant against DB deadlocks.