added logic to pull primary keys from tables during prediction