fix bug:cannot read path of undefined