fix 'missing endfunction' error for dart