cannot use char *str as parameter