fix bug for when=both setting in hyperpars