adding environment variable check