implementation of issue #30