Seems like this code will be executed twice when the ```params[:locale].present?``` returns ```false```. Maybe you can keep only the second call attribution