handle primary_key