add break condition for language detection python