fixing null string checking