fix delete instance bug