fixed eror in MS_optim