fixes #868
Merge pull request #870 from magfest/delete_orphan

fixes #868