fix bug when temporal layer changes

this fix should also resolve abnormal RC (divide 0)