fixed critical wrong var error