Cleanup and correct connection manager