handle err when convert data to string