fix bug in funcs.sh