prevent null dereferencing errors