fix truncate method