outputs id and stores in var