fix wrong npages when closing
Merge pull request #4 from yixuan/master

fix wrong npages when closing