cleanup file handles