Added typechecking to Hooks
Suppress warning, type is checked