Need to check for page index before attempting to access it