fix typo and check only for null
this is a library