fix redirect and cancel.