allow options on closing modal.  don't call onClose if silent == true
prevent history.back on switching to 404 page