adds hasChanges and exit safely