Corrected nested scope error