Remove Yoast Breadcrumb Last Item On Single Pages Only

i got this code from researching and trying to modify it but no luck. I want the last item in yoast breamcrumbs not to appear on single pages only

 if ( is_single() ) {
 /*Remove Last item in Yoast SEO Breadcrumb */
 function adjust_single_breadcrumb( $link_output) {
 if(strpos( $link_output, 'breadcrumb_last' ) !== false ) {
    $link_output = '';
 }
 return $link_output;
 }
 add_filter('wpseo_breadcrumb_single_link', 'adjust_single_breadcrumb' ); 
 };

I tried adding if is single in between the function and also this

 if(strpos( $link_output, 'breadcrumb_last' ) !== false && is_single) {

unfortunately, the whole breadcrumb disappears.