add longest substring