added nill check