fixed problem with deletion of parent objects