Updates again to use popAllPagesAnimated instead of one at a time.