fixed bug in update ref pop