cleaning code for cartHandler