fix error can not encode the data which was retrieved from database