fix bug when then not return function