Initialize variable $itemids properly