fixes element positioning and tracking for nested elements