fixing errors in var