fix for multiple levels of parent tags