fix bug of remove_pages().