bug in instantiating DiazoMiddleware, now only when themes change or debug mode is enabled