bugfix for issue #321