before adding ref