normalize DOM before validation