Implement finalizer