fixed missing var error