Corrected problem with variable scope