added padding to the middleware