cleaning back reffs when removing an entity