fix read truncate functions