removed duplicate func for truncate