past and next button bugs fixed