Add SR cleanup code