fix truncate bug