nil check fixed