fixed too many primary keys bug