fix bug in get previous/next node