closure infer type problem