Added dynamic option for next and prev buttons.