Fix the hooks invocation