fixed a crash reported in  Issue #1