Fixes issue #247

I have a feeling that this pull request fixes a symptom and not the cause, and maybe that is a better solution for this issue