Log closes properly on window close