fix to handle hdfs:// correctly

directory was never put back to self.args.dir after, thus broken for hdfs:// urls