added global stock id check