change to fix issue #4 (not tested)

@Quantisan please review and test re Issue #1