BUG: fix hook deprecation condition.