fixed missing var bug