fixed bugs: del caused indx error, add duplicated entries. running well now.