fixed a variable set but unused warning