copying workaround from #192 to address part of the problem in #171