Updated populate_database.py to handle duplicate records