error handling for cart