working on socket closing.