fix bug when meet subpath