fix bugs & add logging to nameget.sh