Add a macro for setting the hook