fix benchmark, handle error in generating token