added a fix for issue #186
Merge pull request #305 from Skeeve/issue_186

added a fix for issue #186