Adding some middleware.