adding dirty check pattern