Define token_nr before reference