issue 218
Merge pull request #220 from amiton/master

Per romix's request regarding issue #218 here is the changed code via pull request