fixed previous/next errors