added validate public method and fixed next/prev URL generation