proposed solution for issue #414 - from Vitaly