fix bugs (primary_key)
change logic for adding collections