replace strcpy with strdup