removed the mutable variable in favor of a function

Moved the `USE_HDFS` flag and made this a function.  This will make the code more thread safe.