Fixed inverted if statement for hooks

How did I even manage to miss that?