add primary_key check