fixing resetsubtreedirtyflag