fixed the loop. next and prev now work.