need rewrite the path search functions