re-fixed sockets closing outside of loop...