#33 use a class variable to hold tempdir instead of global variable
#33 use a class variable to hold tempdir instead of global variable