fix for nested elements