changed middleware stack method