Thanks to @ids1024 for pagetotal fix