Add debug log on close