correct variable refs