Fix usage of  var when it should be