Should be && not || when checking serverStarted and buffer.length