Fixed a bug caused by adding patch option