Fixed bug on hooks: once a hook changed the document the unsetDirty() method was called that reset tracked collection