Fixing more variable scope