fix the wrong strcpy issue in list() function