def delete(index)
      index = self.index(index) unless index.is_a?(Integer)
      stack.delete_at(index)
    end
def delete(index)
      index = self.index(index) unless index.is_a?(Integer)
      stack.delete_at(index)
    end
Deletes the given middleware object or index