cleanup and try/catch