fix misassignment of var