Added garbage collection for pending relationships