fix next and previous