changing getPath method