Fix variable not found error