small pages count calculation fix