added WebSockets, fixed various segmentation fault errors