Fixed an issue where enabling modal mode would crash ruby if no hook was defined.