Added extra nill check