implementation of set_data in barcode