Closed resources in main