dectect errors in cart, using the logger, and deleting records