fixes second bug in #945