remove middleware wrong