add truncate and count function