Added on exit handler.