change ref into id