Check whole block globally for references rather than each line.