Add the finalize method