Dispose logic