add modulespath error check to fun.sh