do unique check first