another small bug in if in insertStockCode