Add conflict check into a hook.