fix math.ceil() error
numPages should be an int