fix element nesting