add middleware complete