changes for join query