Fix resize race