closes #664