Fix for websockets not finishing