fix wrong var assignment