fix augmentModel for middleware