cleaning up pending references