write to db working. hopefully