added truncate helper in index