fix PrevAndNext & clean up