diff --git a/lib/subdomain_locale/controller.rb b/lib/subdomain_locale/controller.rb
index <HASH>..<HASH> 100644
--- a/lib/subdomain_locale/controller.rb
+++ b/lib/subdomain_locale/controller.rb
@@ -1,13 +1,14 @@
 module SubdomainLocale
   module Controller
     def self.included(base)
-      base.before_filter :set_locale
+      base.around_filter :set_locale
     end
 
     private
 
     def set_locale
-      I18n.locale = SubdomainLocale.mapping.locale_for(request.subdomain)
+      locale = SubdomainLocale.mapping.locale_for(request.subdomain)
+      I18n.with_locale(locale) { yield }
     end
   end
 end
diff --git a/test/rails_test.rb b/test/rails_test.rb
index <HASH>..<HASH> 100644
--- a/test/rails_test.rb
+++ b/test/rails_test.rb
@@ -39,6 +39,12 @@ class HelloControllerTest < ActionController::TestCase
     assert_select "p", "Привіт"
   end
 
+  def test_locale_after_action
+    @request.host = "ru.example.com"
+    get :world
+    assert_equal :en, I18n.locale
+  end
+
   def test_other
     @request.host = "wtf.example.com"
     assert_raise(I18n::InvalidLocale) do
Controller action should revert global locale afterwards.