socket cleanup