Fix conditions to validate a hook