Add generator hook.