writing objects to DB wip