make next/prev buttons correct