make ref and error reference