fixed some bugs related to cart