Fixed problem for selectedIndex is incorrect in pageChangedBlock