I see now. I usually put the endif at the end of each statement instead of all at the bottom of the section.