fix a fatal bug: seg err when path is large