fixed a join bug