fix bug in join.