added loop protection to deleteing temporary profiles