return output in $ret instead of $msg