Ugly fix of SSLStage writeLoop. Needs attention