fix bugs in main in lenv.sh