similar fix to PR #71