added RMS level detection