fixed populate_db so no errors