Made onAfterShow and onAfterHide events