Working on fixing socket close