added truncate feature