working buttons on pageChange