fix a join bug