implement typechecking hooks