change reference from k to ref