add some middleware