Fix hooks deprecation warning