modified flush_lines_queed in db insert