fix nil check.