persist changes to db