use a closure not a function definition