Call the new function in the event listener instead of the one in the old hook.