added currentPageIs and button toggling