added the click listeneer that triggers nextPage