fixed issue with orphaned data