added writes to db