Check if hook exists before trying to run it