bugfix for issue #23