Modified code under SectionPageAdapter