bugfix for issue #313