add setting flag and truncate tool