fix for populate where when using primary keys