fixed connection memory leak;sockets now disconnect correctly