finished adoption function