Added nil check while testing