fixed a bug in join