unsuccessfully tried to fix the not working language detection function
fixed the issue with the language checking function