removed null checks preceding for each loops.