Run function on cancel

Cancelling the modal can now run a function that is passed in as the 3rd parameter.

Pretty small change, was need in one of my projects.

(First PR, anything else I need to do?)