Fixed some bugs about the path