fixed middleware