fixed directp->d_name[0] to directp->d_name