Add "onBeforeHide" and "onDestroy" options