bugfix for issue #40