fix error when environment variable is not set