Fixed callbacks in parallel db writing