snippet for adding ref