[fix] lang detection when error occurs