Disable buttons for next and previous when necessary