decoding string only if needed