made the next and prev buttons work better