closes #667