remove bug from delete Pathfunction