fixed the infinite cancel issue