Add method to check whether attributes have been modified.