fix multiway join