add error and string decoding