added onCancel handler