fixed bugs for delelte and self update