fix bug for origins with a function