Added function to remove path element.