Fixed a case when from_ or to is undefined