cleanup output handler