updated to use live data
updated to avoid crashes when 'HOST' is not defined for os.environ