add a middle ware