fine tune the onHide's mechanism