Fixed bug in set function of namesApi