Fixed bug in join from previous pull request