Add auto_close option to new()