dom updating corectly