debugging closure problem