Added check if ENVIRONMENT variable is actually set before reading it