fixes prev and next buttons