fix issue #22

Depend on PR #24