compatible with the new interface of 'invnrnd'