Beverage production machine for the preparation of a nutritional product from capsules containing nutritional ingredients comprising: a housing; a reservoir for holding a liquid; a capsule holder removably insertable in the housing for holding a capsule containing nutritional ingredients; a liquid injection assembly (14a, 14b) provided in the housing for supplying liquid held in the reservoir to a capsule held in the capsule holder, an optical code reading assembly comprising: a code reader for reading an optically readable code on each capsule placed in the capsule holder when the capsule holder is inserted in the housing, a control unit adapted to set at least one preparation parameter, for the nutritional product, such as the volume of supplied liquid in the capsule, characterized in that the control unit includes a memory for memorizing the last optically readable codes read by the code reader, such as the last 10 or 20 optically readable codes and in that the control unit is adapted to deactivate the beverage production machine and/or to provide a warning signal to the user of the beverage production machine, in case that an optically readable code read by the code reader corresponds to one of the last memorized optical codes, and the control unit is adapted to set the at least one preparation parameter according to the optically readable code of the capsule read by the code reader in case the optically readable code does not correspond to one of the last memorized optically readable codes. a housing; a reservoir for holding a liquid; a capsule holder removably insertable in the housing for holding a capsule containing nutritional ingredients; a liquid injection assembly (14a, 14b) provided in the housing for supplying liquid held in the reservoir to a capsule held in the capsule holder, an optical code reading assembly comprising: a code reader for reading an optically readable code on each capsule placed in the capsule holder when the capsule holder is inserted in the housing, a control unit adapted to set at least one preparation parameter, for the nutritional product, such as the volume of supplied liquid in the capsule, characterized in that the control unit includes a memory for memorizing the last optically readable codes read by the code reader, such as the last 10 or 20 optically readable codes and in that the control unit is adapted to deactivate the beverage production machine and/or to provide a warning signal to the user of the beverage production machine, in case that an optically readable code read by the code reader corresponds to one of the last memorized optical codes, and the control unit is adapted to set the at least one preparation parameter according to the optically readable code of the capsule read by the code reader in case the optically readable code does not correspond to one of the last memorized optically readable codes. a code reader for reading an optically readable code on each capsule placed in the capsule holder when the capsule holder is inserted in the housing, a control unit adapted to set at least one preparation parameter, for the nutritional product, such as the volume of supplied liquid in the capsule, characterized in that the control unit includes a memory for memorizing the last optically readable codes read by the code reader, such as the last 10 or 20 optically readable codes and in that the control unit is adapted to deactivate the beverage production machine and/or to provide a warning signal to the user of the beverage production machine, in case that an optically readable code read by the code reader corresponds to one of the last memorized optical codes, and the control unit is adapted to set the at least one preparation parameter according to the optically readable code of the capsule read by the code reader in case the optically readable code does not correspond to one of the last memorized optically readable codes.