add fields from joins to select
cleaned up for merge