comment on why i added the null check