Updated save to sqlite mechanism