implement the previous button to get the previous page