fix for issue 1057
Merge pull request #1060 from memimo/1057

fix for issue 1057