Merge pull request #436 from jrperritt/allpages-bug-fix

fix index out of bounds error