update the purge_obj function.