added table-alias awareness to joins