use label index for removing the temp ids