improved detection of undefined languages