Bug fix for undefined cart