Update middleware to remove warning