Added Previous button functionality