fix minor bugs in path and a new system for path deleting