fix casting unicode error message