directly write to db