trying to compose conditional joins