fix bug in issue #22