Added cancel and ok events upon close
Added cancel and ok events upon close