correct max_pages as int