better logging on close and error