non-totally working with q on exit -- trying to make script more robust with set -e/-u