Bug fix: undefined pageNum in destructor