fixed dirty() and pristine()