update cart and handling errors