fixed infinite loop on changepage