I get that sometimes too, I don't know if there's an automatic way for it to cancel but I mostly do it manually by moving a little or pressing Esc.