bugfix of issue #85 and #86