added a call to clear the cach if the element hierarchy is modified

that is if a path is added or deleted the cache should be refreshed