updated middleware to add cart to request