partially fix #223
Merge pull request #224 from paul7/master

partially fix #223