fixed a problem when no cart is given