fix replacing decode_with_length