fixed sub and typo in var