Adding in a safe guard for if $TMP_DIR wasn't provided