fix for #339
Merge pull request #341 from nikhan/fix#339

fix for #339