Fix a a undefined vairable issue