fixed missing var declaration