added automated language detection