Fixed a bug where the parent refs where left in the backend