renamed haschanged to isDirty