added in write to db