change err to out