solve the bug of Next and RNext