Prevent running hooks from other routes

This had been solved in dev but hasn't made it to master.