fixed issue #111 (thanks to balchen)