Finish db operations