Add null check to the id field too