Make a command for cancel and wire it up.
Remove multiple debug variables.
Don't convert null parameters to bool for Dynamic run.
Don't override element state if in error.