fixes Issue #47

Creating a new pull request to merge changes which fixe Issue #47