loads middlewares sorted by slot into the next active array