save refId after registration in DB