Fixes issues #49 - Make sure only do socket.send when connected