adding support to get instances hierarchy
supporting instances hierarchy