diff --git a/lib/font_assets/railtie.rb b/lib/font_assets/railtie.rb
index efc801d..51e773e 100644
--- a/lib/font_assets/railtie.rb
+++ b/lib/font_assets/railtie.rb
@@ -8,7 +8,7 @@ class Railtie < Rails::Railtie
       config.font_assets.origin ||= "*"
       config.font_assets.options ||= { allow_ssl: true }
 
-      insert_target = if defined?(ActionDispatch::Static)
+      insert_target = if app.config.serve_static_files
         'ActionDispatch::Static'
       else
         'Rack::Runtime'