fixed double let statements scoping bug