NEW configure middleware