Need to fix problem with ref not saving visibility id