putting middleware back