changed io to socket at end