bugfix for issue #24