fix for #168
 error reporting if clause added
Merge pull request #169 from mklauser/fix_168

fix for #168