import socket. fixes issue when socket isn't defined.