closes #866