rework prev and next buttons