added broken free_children function