fix issue of lost scope