better error handling in join functions. closes #371