add error handling for invalid carts