solving problem of removed parents ids