update middleware & beego's error