Buggy implementation of the cart