adding IsClosed() and trying to fix an error in Send