fixing the join bug