added set -u block

set -u forces all envars to be required