removed old prefs, fixing socket.close()