fix RMS bug