closes #585