fix case when $page_ids is empty