Update middleware.go