resolved nbPages bug