Improve hooks hash validation