Additional error procession, removed unused websocket code