closes #665