Improve code for selecting language

I noticed that we had to set up language var to display rules otherwise it returned empty page - in case when there is only one available language.