slight optimization while checking isDirty