fixed remove ref error