move static middleware to the end of the stack