disable prev and next at two ends