added simple WebSocket middleware, but sometimes failing