Update to getPath function