Better error message

fix #1070