reordering middleware - old config was incorrect