fix bug when optim parameter (other than joint