fix bug  is undefined