added patch for select_related