more cleanup, and try catches