grab total page num better (Im stupid)