Added discardChanges method