update example, more logging
cleanup before exiting