almost working isDirty example