error handling for class and cart