better error report, fixed issues #81 and #82