use nnext and fix bug