close over some state