added language detection