fixed numpages issue