now checking for environment variables up front