write names to db