Merge pull request #817 from leider/master

fix for #815 #816