Fix unrefeferenced variable