fix bug when only adding one page
Merge pull request #45 from nhart/6.x

fix bug when only adding one page