copy from ref