clean middleware command