Change TOA to toArray, make smarter in page hanging