fixing issue #779
Merge pull request #780 from peterkir/master

fixing issue #779