cleaned up websockets.js