fix cleanvar and race around