fix some bugs && add onShow onClose onBeforeShow onBeforeClose actions