to avoid some Nil exceptions