fixed error at calling truncate method