Middleware fails to be loaded when added dynamically.