fix bug with label -> ref