made changes in previous and next buttons