added nil check for section validation