fix crash in issue #16