bugfix for previous/next