Updated script to fix error empty cart