fixed bug in join script