fixed RMSE code