changed middleware to config