fix next/prev navigation bug