fixing enclosure element refernce logic