added socked closing