adding indexStack,removing anonymous doc listener