custom accordion (repeater) with velo code

$w('#repeater1').forEachItem(($item) => {
		//console.log('#repeater1')
		$item('#trigger').onClick(() => {
			if ($item('#box20').collapsed)
			    $item('#box20').expand();
			else
			   $item('#box20').collapse();
		})
	})

this is my added code for collapsing and expending
but somthing in not working

#trigger = the button
$item = item in the repeater
#box20 = the container that i want to show/hide

the #box20 is also maked as collapsed in the checkbox
and the button is enabeld
so everything is very straightforward
but im probably missing something so please inlight me if you can help
can share my editor x workspace if needed

$w.onReady(()=>{
   $w('#repeater1').forEachItem(($item, iData, index) => {
	   $item('#trigger').onClick((event)=> {
			if ($item('#box20').collapsed(){
			    $item('#box20').expand();
              }
			else {
		        $item('#box20').collapse();
              }
	   });
   });
});

Thank you the code look legit but it still doesn’t work for some reason