code adjusted for properly work with latest core and coref updates
conflict fixed