Fixing orphan handling

Small bug to fix orphaned handling