close all at end of -main