MOved in middleware.