fix duplicate var assignment