handling two or more join conditions