Fixed issue #534; when cancel is clicked return immediately
fix merge conflict