fixed bugs in delete and details, not set relationships correctly before