updated logic to render element by it's name