fixed replicate name function