fix foreign character crash