get total pages number automatically
update motions