Add constraint for page bound. Before loadPage did nothing if the page number was out of bount, now it go to page 1 if number is < 1, or to last page if number if > last page.