Added additional type check when comparing values for isDirty check