finish db insert