making it a hook and not a plugin