support "OnClose"