fix issue #40
Merge pull request #45 from robjhyndman/enhancement

fix issue #40