fix to syntax and better error output sample