fix deprecated truncate usage