closes #640