change code to merge middleware