add exit logging