fixed the issue with identifying a parent for an element