fixed bugs related to deleting and upgrading everything