fix SR replacement logic