fix a bug that when there are multiple ".."