Why is this running in a loop? Shouldn't we only be clicking cancel once?