after calling the stop, query the status in loop:

do sleep 0.1 until $service.status = $stopped
_________________________
!

download KiXnet