Fixed ref to tag in each function