middlewares of main namespace should be called first

When you set middlewares both with and without namespaces, these middleware functions run in parallel. I believe it should run in series.