modify get path function