change the hook function