Bad var assignment fixed