fix canonical for null case