Use unshift instead of push for middlewares.