middleware now supports terminate, the caveat is gone