Adding environment variable checks