5.4 middleware